import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'
const IdKey = 'Admin-Id'
const NameKey = 'Admin-Name'
const UserNameKey = 'Admin-UserName'
const PasswordKey = 'Admin-Password'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function getId() {
  return Cookies.get(IdKey)
}

export function getName() {
  return Cookies.get(NameKey)
}

export function getUserName() {
  return Cookies.get(UserNameKey)
}

export function getPassword() {
  return Cookies.get(PasswordKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function setId(id) {
  return Cookies.set(IdKey, id, { expires: 365 })
}

export function setName(name) {
  return Cookies.set(NameKey, name)
}

export function setUserName(name) {
  return Cookies.set(UserNameKey, name)
}

export function setPassword(pwd) {
  return Cookies.set(PasswordKey, pwd)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function removeId() {
  return Cookies.remove(IdKey)
}
